﻿using System;

// Token: 0x020001ED RID: 493
public class ActionSequence : AgentAction
{
	// Token: 0x06000A70 RID: 2672 RVA: 0x0005A99F File Offset: 0x00058B9F
	public override bool CanInterrupt()
	{
		return this.actions[0].CanInterrupt();
	}

	// Token: 0x06000A71 RID: 2673 RVA: 0x0005A9B0 File Offset: 0x00058BB0
	public override bool CanDoBoth(AgentAction anotherAction)
	{
		foreach (AgentAction agentAction in this.actions)
		{
			if (!agentAction.CanDoBoth(anotherAction))
			{
				return false;
			}
		}
		return true;
	}

	// Token: 0x06000A72 RID: 2674 RVA: 0x0005A9EB File Offset: 0x00058BEB
	public override bool IsCompleted()
	{
		return this.activeIndex >= this.actions.Length;
	}

	// Token: 0x06000A73 RID: 2675 RVA: 0x0005AA00 File Offset: 0x00058C00
	public override void Execute()
	{
		if (!this.initialized)
		{
			foreach (AgentAction agentAction in this.actions)
			{
				agentAction.agent = this.agent;
			}
			this.initialized = true;
		}
		this.priority = this.actions[this.activeIndex].priority;
		this.actions[this.activeIndex].Execute();
		if (this.actions[this.activeIndex].IsCompleted())
		{
			this.activeIndex++;
		}
	}

	// Token: 0x04000FAD RID: 4013
	protected AgentAction[] actions;

	// Token: 0x04000FAE RID: 4014
	private int activeIndex;

	// Token: 0x04000FAF RID: 4015
	private bool initialized;
}
